package com.mvc.controller;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.springframework.web.servlet.ModelAndView;
import org.springframework.web.servlet.mvc.Controller;

public class HelloMVCController implements Controller{

	public ModelAndView handleRequest(HttpServletRequest arg0, HttpServletResponse arg1) throws Exception {
		//ModelAndView模型与视图
		ModelAndView mav=new ModelAndView();
		//封装对象,放在ModelAndView中,在NewFile.jsp中放置对象并使用
		mav.addObject("msg","hellospringmvc");
//		跳转到NewFile.jsp
		mav.setViewName("NewFile");
		return mav;
	}

}
